"""pro URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,re_path
from index import views
from table.views import *

urlpatterns = [
    # index
    path('admin/', admin.site.urls),
    path('add_user/',views.add_user),
    path('',views.index),
    path('login/',views.login),
    path('reg/',views.reg),
    path('user_list/',views.user_list),
    path('edit_user/',views.edit_user),
    path('del_user/',views.del_user),
    path('welcome/',views.welcome),
    path('add_user_simple/',views.add_user_simple),
    path('ret_user_simple/',views.ret_user_simple),
    path('update_user_simple/',views.update_user_simple),

    # table
    path('add_book_121/',add_book_121),
    path('add_book_m2m/',add_book_m2m),
    path('rele_manager_forward/',rele_manager_forward),
    path('rele_manage_reverse/',rele_manage_reverse),

    re_path('^index/([0-9]{4})/$',index_no_name),
    re_path("^index/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$", index_has_name),
]

# 路由分发
from django.urls import include

# 在master、main文件下创建urls.py

urlpatterns = [
    path('admin/',admin.site.urls),
    # http://127.0.0.1:8000/main/index/
    path('main/',include('main.urls')),
    path('master/',include('master.urls')),
]